from urllib import parse
# 解析 url
url='https://www.baidu.com/s?ie=utf-8&f=3&rsv_bp=1&rsv_idx=1'
result=parse.urlparse(url)
print(result)
print(result.scheme)
print(result.netloc)
print(result.query)

result1=parse.urlsplit(url)

print(result1)
print(result1.scheme)
print(result1.netloc)
print(result1.query)
